home *** CD-ROM | disk | FTP | other *** search
/ TeX 1995 July / TeX CD-ROM July 1995 (Disc 1)(Walnut Creek)(1995).ISO / biblio / bibtex / contrib / phy-bstyles / rmp.bst < prev   
Text File  |  1992-06-14  |  24KB  |  1,313 lines

  1. %% #define RMP 1        % Thu Jun 14 13:26:15 1990
  2. %% #include "TEX$ROOT:[BIBTEX]PHYSICS.BTX"
  3.     % Please notify Charles Karney (Karney@Princeton.EDU)
  4.     % of any bugs, improvements, etc.
  5.  
  6.     % For Reviews of Modern Physics, 
  7.  
  8.     % version 0.99b for BibTeX versions 0.99a or later, LaTeX version 2.09.
  9.     % Copyright (C) 1985, all rights reserved.
  10.     % Copying of this file is authorized only if either
  11.     % (1) you make absolutely no changes to your copy, including name, or
  12.     % (2) if you do make changes, you name it something other than
  13.     % btxbst.doc, plain.bst, unsrt.bst, alpha.bst, and abbrv.bst.
  14.     % This restriction helps ensure that all standard styles are identical.
  15.     % The file btxbst.doc has the documentation for this style.
  16.  
  17. ENTRY
  18.   { address
  19.     author
  20.     booktitle
  21.     chapter
  22.     edition
  23.     editor
  24.     howpublished
  25.     institution
  26.     journal
  27.     key
  28.     month
  29.     note
  30.     number
  31.     organization
  32.     pages
  33.     publisher
  34.     school
  35.     series
  36.     title
  37.     type
  38.     volume
  39.     year
  40.   }
  41.   {}
  42.   { label extra.label sort.label }
  43.  
  44. INTEGERS { output.state before.all mid.sentence after.sentence after.block }
  45.  
  46. FUNCTION {init.state.consts}
  47. { #0 'before.all :=
  48.   #1 'mid.sentence :=
  49.   #2 'after.sentence :=
  50.   #3 'after.block :=
  51. }
  52.  
  53. STRINGS { s t }
  54.  
  55. FUNCTION {output.nonnull}
  56. { 's :=
  57.   output.state mid.sentence =
  58.     { ", " * write$ }
  59.     { output.state after.block =
  60.     { "," * write$
  61.       newline$
  62.       "\newblock " write$
  63.     }
  64.     { output.state before.all =
  65.         'write$
  66.         { add.period$ " " * write$ }
  67.       if$
  68.     }
  69.       if$
  70.       mid.sentence 'output.state :=
  71.     }
  72.   if$
  73.   s
  74. }
  75.  
  76. FUNCTION {output}
  77. { duplicate$ empty$
  78.     'pop$
  79.     'output.nonnull
  80.   if$
  81. }
  82.  
  83. FUNCTION {output.check}
  84. { 't :=
  85.   duplicate$ empty$
  86.     { pop$ "empty " t * " in " * cite$ * warning$ }
  87.     'output.nonnull
  88.   if$
  89. }
  90.  
  91. FUNCTION {output.bibitem}
  92. { newline$
  93.   "\bibitem[" write$
  94.   label write$
  95.   "]{" write$
  96.   cite$ write$
  97.   "}" write$
  98.   newline$
  99.   ""
  100.   before.all 'output.state :=
  101. }
  102.  
  103. FUNCTION {fin.entry}
  104. { add.period$
  105.   write$
  106.   newline$
  107. }
  108.  
  109. FUNCTION {new.block}
  110. { output.state before.all =
  111.     'skip$
  112.     { after.block 'output.state := }
  113.   if$
  114. }
  115.  
  116. FUNCTION {new.sentence}
  117. { skip$
  118. }
  119.  
  120. FUNCTION {not}
  121. {   { #0 }
  122.     { #1 }
  123.   if$
  124. }
  125.  
  126. FUNCTION {and}
  127. {   'skip$
  128.     { pop$ #0 }
  129.   if$
  130. }
  131.  
  132. FUNCTION {or}
  133. {   { pop$ #1 }
  134.     'skip$
  135.   if$
  136. }
  137.  
  138. FUNCTION {new.block.checka}
  139. { empty$
  140.     'skip$
  141.     'new.block
  142.   if$
  143. }
  144.  
  145. FUNCTION {new.block.checkb}
  146. { empty$
  147.   swap$ empty$
  148.   and
  149.     'skip$
  150.     'new.block
  151.   if$
  152. }
  153.  
  154. FUNCTION {new.sentence.checka}
  155. { empty$
  156.     'skip$
  157.     'new.sentence
  158.   if$
  159. }
  160.  
  161. FUNCTION {new.sentence.checkb}
  162. { empty$
  163.   swap$ empty$
  164.   and
  165.     'skip$
  166.     'new.sentence
  167.   if$
  168. }
  169.  
  170. FUNCTION {field.or.null}
  171. { duplicate$ empty$
  172.     { pop$ "" }
  173.     'skip$
  174.   if$
  175. }
  176.  
  177. FUNCTION {emphasize}
  178. { duplicate$ empty$
  179.     { pop$ "" }
  180.     { "{\em " swap$ * "}" * }
  181.   if$
  182. }
  183.  
  184. FUNCTION {embolden}
  185. { duplicate$ empty$
  186.     { pop$ "" }
  187.     { "{\bf " swap$ * "}" * }
  188.   if$
  189. }
  190.  
  191. FUNCTION {bracket}
  192. { duplicate$ empty$
  193.     { pop$ "" }
  194.     { "[" swap$ * "]" * }
  195.   if$
  196. }
  197.  
  198. INTEGERS { nameptr namesleft numnames }
  199.  
  200. FUNCTION {format.names}
  201. { 's :=
  202.   #1 'nameptr :=
  203.   s num.names$ 'numnames :=
  204.   numnames 'namesleft :=
  205.     { namesleft #0 > }
  206.     { s nameptr "{f.~}{vv~}{ll}{, jj}" format.name$ 't :=
  207.       nameptr #1 >
  208.     { namesleft #1 >
  209.         { ", " * t * }
  210.         { numnames #2 >
  211.         { "," * }
  212.         'skip$
  213.           if$
  214.           t "others" =
  215.         { " et~al." * }
  216.         { " and " * t * }
  217.           if$
  218.         }
  219.       if$
  220.     }
  221.     't
  222.       if$
  223.       nameptr #1 + 'nameptr :=
  224.       namesleft #1 - 'namesleft :=
  225.     }
  226.   while$
  227. }
  228.  
  229. FUNCTION {format.authors}
  230. { author empty$
  231.     { "" }
  232.     { author format.names }
  233.   if$
  234. }
  235.  
  236. FUNCTION {format.editors}
  237. { editor empty$
  238.     { "" }
  239.     { editor format.names
  240.       editor num.names$ #1 >
  241.     { ", editors" * }
  242.     { ", editor" * }
  243.       if$
  244.     }
  245.   if$
  246. }
  247.  
  248. FUNCTION {format.edited}
  249. { editor empty$
  250.     { "" }
  251.     { "edited by " editor format.names * }
  252.   if$
  253. }
  254.  
  255. FUNCTION {format.title}
  256. { title empty$
  257.     { "" }
  258.     { title "t" change.case$ }
  259.   if$
  260. }
  261.  
  262. FUNCTION {n.dashify}
  263. { 't :=
  264.   ""
  265.     { t empty$ not }
  266.     { t #1 #1 substring$ "-" =
  267.     { t #1 #2 substring$ "--" = not
  268.         { "--" *
  269.           t #2 global.max$ substring$ 't :=
  270.         }
  271.         {   { t #1 #1 substring$ "-" = }
  272.         { "-" *
  273.           t #2 global.max$ substring$ 't :=
  274.         }
  275.           while$
  276.         }
  277.       if$
  278.     }
  279.     { t #1 #1 substring$ *
  280.       t #2 global.max$ substring$ 't :=
  281.     }
  282.       if$
  283.     }
  284.   while$
  285. }
  286.  
  287. FUNCTION {first.page}
  288. { 't :=
  289.   ""
  290.     {  t empty$ not t #1 #1 substring$ "-" = not and }
  291.     { t #1 #1 substring$ *
  292.       t #2 global.max$ substring$ 't :=
  293.     }
  294.   while$
  295. }
  296.  
  297. FUNCTION {format.date}
  298. { year empty$
  299.     { month empty$
  300.     { "" }
  301.     { "there's a month but no year in " cite$ * warning$
  302.       month
  303.     }
  304.       if$
  305.     }
  306.     { month empty$
  307.     'year
  308.     { month " " * year * }
  309.       if$
  310.     }
  311.   if$
  312. }
  313.  
  314. FUNCTION {format.btitle}
  315. { title emphasize
  316. }
  317.  
  318. FUNCTION {tie.or.space.connect}
  319. { duplicate$ text.length$ #3 <
  320.     { "~" }
  321.     { " " }
  322.   if$
  323.   swap$ * *
  324. }
  325.  
  326. FUNCTION {either.or.check}
  327. { empty$
  328.     'pop$
  329.     { "can't use both " swap$ * " fields in " * cite$ * warning$ }
  330.   if$
  331. }
  332.  
  333. FUNCTION {format.bvolume}
  334. { volume empty$
  335.     { "" }
  336.     { "volume" volume tie.or.space.connect
  337.       series empty$
  338.     'skip$
  339.     { " of " * series emphasize * }
  340.       if$
  341.       "volume and number" number either.or.check
  342.     }
  343.   if$
  344. }
  345.  
  346. FUNCTION {format.number.series}
  347. { volume empty$
  348.     { number empty$
  349.     { series field.or.null }
  350.     { output.state mid.sentence =
  351.         { "number" }
  352.         { "Number" }
  353.       if$
  354.       number tie.or.space.connect
  355.       series empty$
  356.         { "there's a number but no series in " cite$ * warning$ }
  357.         { " in " * series * }
  358.       if$
  359.     }
  360.       if$
  361.     }
  362.     { "" }
  363.   if$
  364. }
  365.  
  366. FUNCTION {format.edition}
  367. { edition empty$
  368.     { "" }
  369.     { output.state mid.sentence =
  370.     { edition "l" change.case$ " edition" * }
  371.     { edition "t" change.case$ " edition" * }
  372.       if$
  373.     }
  374.   if$
  375. }
  376.  
  377. INTEGERS { multiresult }
  378.  
  379. FUNCTION {multi.page.check}
  380. { 't :=
  381.   #0 'multiresult :=
  382.     { multiresult not
  383.       t empty$ not
  384.       and
  385.     }
  386.     { t #1 #1 substring$
  387.       duplicate$ "-" =
  388.       swap$ duplicate$ "," =
  389.       swap$ "+" =
  390.       or or
  391.     { #1 'multiresult := }
  392.     { t #2 global.max$ substring$ 't := }
  393.       if$
  394.     }
  395.   while$
  396.   multiresult
  397. }
  398.  
  399. FUNCTION {format.pages}
  400. { pages empty$
  401.     { "" }
  402.     { pages multi.page.check
  403.     { "pp." pages n.dashify tie.or.space.connect }
  404.     { "p." pages tie.or.space.connect }
  405.       if$
  406.     }
  407.   if$
  408. }
  409.  
  410. FUNCTION {format.pages.a}
  411. { pages empty$
  412.     { "" }
  413.     { "p." pages first.page tie.or.space.connect }
  414.   if$
  415. }
  416.  
  417. FUNCTION {format.vol.num.pages}
  418. { volume field.or.null embolden
  419.   pages empty$
  420.     'skip$
  421.     { duplicate$ empty$
  422.     { pop$ format.pages.a }
  423.     { ":" * pages first.page * }
  424.       if$
  425.     }
  426.   if$
  427. }
  428.  
  429. FUNCTION {format.chapter.pages}
  430. { chapter empty$
  431.     'format.pages
  432.     { type empty$
  433.     { "chapter" }
  434.     { type "l" change.case$ }
  435.       if$
  436.       chapter tie.or.space.connect
  437.       pages empty$
  438.     'skip$
  439.     { ", " * format.pages * }
  440.       if$
  441.     }
  442.   if$
  443. }
  444.  
  445. FUNCTION {format.in.ed.booktitle}
  446. { booktitle empty$
  447.     { "" }
  448.     { editor empty$
  449.     { "in " booktitle emphasize * }
  450.     { "in " booktitle emphasize * ", " * format.edited * }
  451.       if$
  452.     }
  453.   if$
  454. }
  455.  
  456. FUNCTION {empty.misc.check}
  457. { author empty$ title empty$ howpublished empty$
  458.   month empty$ year empty$ note empty$
  459.   and and and and and
  460.   key empty$ not and
  461.     { "all relevant fields are empty in " cite$ * warning$ }
  462.     'skip$
  463.   if$
  464. }
  465.  
  466. FUNCTION {format.thesis.type}
  467. { type empty$
  468.     'skip$
  469.     { pop$
  470.       type "t" change.case$
  471.     }
  472.   if$
  473. }
  474.  
  475. FUNCTION {format.tr.number}
  476. { type empty$
  477.     { "Technical Report" }
  478.     'type
  479.   if$
  480.   number empty$
  481.     { "t" change.case$ }
  482.     { number tie.or.space.connect }
  483.   if$
  484. }
  485.  
  486. FUNCTION {format.article.crossref}
  487. { key empty$
  488.     { journal empty$
  489.     { "need key or journal for " cite$ * " to crossref " * crossref *
  490.       warning$
  491.       ""
  492.     }
  493.     { "In " journal * }
  494.       if$
  495.     }
  496.     { "In " key * }
  497.   if$
  498.   " \cite{" * crossref * "}" *
  499. }
  500.  
  501. FUNCTION {format.crossref.editor}
  502. { editor #1 "{vv~}{ll}" format.name$
  503.   editor num.names$ duplicate$
  504.   #2 >
  505.     { pop$ " et~al." * }
  506.     { #2 <
  507.     'skip$
  508.     { editor #2 "{ff }{vv }{ll}{ jj}" format.name$ "others" =
  509.         { " et~al." * }
  510.         { " and " * editor #2 "{vv~}{ll}" format.name$ * }
  511.       if$
  512.     }
  513.       if$
  514.     }
  515.   if$
  516. }
  517.  
  518. FUNCTION {format.book.crossref}
  519. { volume empty$
  520.     { "empty volume in " cite$ * "'s crossref of " * crossref * warning$
  521.       "In "
  522.     }
  523.     { "Volume" volume tie.or.space.connect
  524.       " of " *
  525.     }
  526.   if$
  527.   editor empty$
  528.   editor field.or.null author field.or.null =
  529.   or
  530.     { key empty$
  531.     { series empty$
  532.         { "need editor, key, or series for " cite$ * " to crossref " *
  533.           crossref * warning$
  534.           "" *
  535.         }
  536.         { "{\em " * series * "\/}" * }
  537.       if$
  538.     }
  539.     { key * }
  540.       if$
  541.     }
  542.     { format.crossref.editor * }
  543.   if$
  544.   " \cite{" * crossref * "}" *
  545. }
  546.  
  547. FUNCTION {format.incoll.inproc.crossref}
  548. { editor empty$
  549.   editor field.or.null author field.or.null =
  550.   or
  551.     { key empty$
  552.     { booktitle empty$
  553.         { "need editor, key, or booktitle for " cite$ * " to crossref " *
  554.           crossref * warning$
  555.           ""
  556.         }
  557.         { "In {\em " booktitle * "\/}" * }
  558.       if$
  559.     }
  560.     { "In " key * }
  561.       if$
  562.     }
  563.     { "In " format.crossref.editor * }
  564.   if$
  565.   " \cite{" * crossref * "}" *
  566. }
  567.  
  568. FUNCTION {article}
  569. { output.bibitem
  570.   format.authors "author" output.check
  571.   new.block
  572.   crossref missing$
  573.     { journal "journal" output.check
  574.       format.vol.num.pages output
  575.       format.date "year" output.check
  576.     }
  577.     { format.article.crossref output.nonnull
  578.       format.pages output
  579.     }
  580.   if$
  581.   new.block
  582.   note output
  583.   fin.entry
  584. }
  585.  
  586. FUNCTION {book}
  587. { output.bibitem
  588.   author empty$
  589.     { format.editors "author and editor" output.check }
  590.     { format.authors output.nonnull
  591.       crossref missing$
  592.     { "author and editor" editor either.or.check }
  593.     'skip$
  594.       if$
  595.     }
  596.   if$
  597.   new.block
  598.   format.btitle "title" output.check
  599.   crossref missing$
  600.     { format.bvolume output
  601.       new.block
  602.       format.number.series output
  603.       new.sentence
  604.       publisher "publisher" output.check
  605.       address output
  606.     }
  607.     { new.block
  608.       format.book.crossref output.nonnull
  609.     }
  610.   if$
  611.   format.edition output
  612.   format.date "year" output.check
  613.   new.block
  614.   note output
  615.   fin.entry
  616. }
  617.  
  618. FUNCTION {booklet}
  619. { output.bibitem
  620.   format.authors output
  621.   new.block
  622.   format.title "title" output.check
  623.   howpublished address new.block.checkb
  624.   howpublished output
  625.   address output
  626.   format.date output
  627.   new.block
  628.   note output
  629.   fin.entry
  630. }
  631.  
  632. FUNCTION {inbook}
  633. { output.bibitem
  634.   author empty$
  635.     { format.editors "author and editor" output.check }
  636.     { format.authors output.nonnull
  637.       crossref missing$
  638.     { "author and editor" editor either.or.check }
  639.     'skip$
  640.       if$
  641.     }
  642.   if$
  643.   new.block
  644.   format.btitle "title" output.check
  645.   crossref missing$
  646.     { format.bvolume output
  647.       format.chapter.pages "chapter and pages" output.check
  648.       new.block
  649.       format.number.series output
  650.       new.sentence
  651.       publisher "publisher" output.check
  652.       address output
  653.     }
  654.     { format.chapter.pages "chapter and pages" output.check
  655.       new.block
  656.       format.book.crossref output.nonnull
  657.     }
  658.   if$
  659.   format.edition output
  660.   format.date "year" output.check
  661.   new.block
  662.   note output
  663.   fin.entry
  664. }
  665.  
  666. FUNCTION {incollection}
  667. { output.bibitem
  668.   format.authors "author" output.check
  669.   new.block
  670.   format.title "title" output.check
  671.   new.block
  672.   crossref missing$
  673.     { format.in.ed.booktitle "booktitle" output.check
  674.       format.bvolume output
  675.       format.number.series output
  676.       format.chapter.pages output
  677.       new.sentence
  678.       publisher "publisher" output.check
  679.       address output
  680.       format.edition output
  681.       format.date "year" output.check
  682.     }
  683.     { format.incoll.inproc.crossref output.nonnull
  684.       format.chapter.pages output
  685.     }
  686.   if$
  687.   new.block
  688.   note output
  689.   fin.entry
  690. }
  691.  
  692. FUNCTION {inproceedings}
  693. { output.bibitem
  694.   format.authors "author" output.check
  695.   new.block
  696.   format.title "title" output.check
  697.   new.block
  698.   crossref missing$
  699.     { format.in.ed.booktitle "booktitle" output.check
  700.       format.bvolume output
  701.       format.number.series output
  702.       format.pages output
  703.       address empty$
  704.     { organization publisher new.sentence.checkb
  705.       organization output
  706.       publisher output
  707.       format.date "year" output.check
  708.     }
  709.     { address output.nonnull
  710.       format.date "year" output.check
  711.       new.sentence
  712.       organization output
  713.       publisher output
  714.     }
  715.       if$
  716.     }
  717.     { format.incoll.inproc.crossref output.nonnull
  718.       format.pages output
  719.     }
  720.   if$
  721.   new.block
  722.   note output
  723.   fin.entry
  724. }
  725.  
  726. FUNCTION {conference} { inproceedings }
  727.  
  728. FUNCTION {manual}
  729. { output.bibitem
  730.   author empty$
  731.     { organization empty$
  732.     'skip$
  733.     { organization output.nonnull
  734.       address output
  735.     }
  736.       if$
  737.     }
  738.     { format.authors output.nonnull }
  739.   if$
  740.   new.block
  741.   format.btitle "title" output.check
  742.   author empty$
  743.     { organization empty$
  744.     { address new.block.checka
  745.       address output
  746.     }
  747.     'skip$
  748.       if$
  749.     }
  750.     { organization address new.block.checkb
  751.       organization output
  752.       address output
  753.     }
  754.   if$
  755.   format.edition output
  756.   format.date output
  757.   new.block
  758.   note output
  759.   fin.entry
  760. }
  761.  
  762. FUNCTION {mastersthesis}
  763. { output.bibitem
  764.   format.authors "author" output.check
  765.   new.block
  766.   format.title "title" output.check
  767.   new.block
  768.   "Master's thesis" format.thesis.type output.nonnull
  769.   school "school" output.check
  770.   address output
  771.   format.date "year" output.check
  772.   new.block
  773.   note output
  774.   fin.entry
  775. }
  776.  
  777. FUNCTION {misc}
  778. { output.bibitem
  779.   format.authors output
  780.   title howpublished new.block.checkb
  781.   format.title output
  782.   howpublished new.block.checka
  783.   howpublished output
  784.   format.date output
  785.   new.block
  786.   note output
  787.   fin.entry
  788.   empty.misc.check
  789. }
  790.  
  791. FUNCTION {phdthesis}
  792. { output.bibitem
  793.   format.authors "author" output.check
  794.   new.block
  795.   format.btitle "title" output.check
  796.   new.block
  797.   "PhD thesis" format.thesis.type output.nonnull
  798.   school "school" output.check
  799.   address output
  800.   format.date "year" output.check
  801.   new.block
  802.   note output
  803.   fin.entry
  804. }
  805.  
  806. FUNCTION {proceedings}
  807. { output.bibitem
  808.   editor empty$
  809.     { organization output }
  810.     { format.editors output.nonnull }
  811.   if$
  812.   new.block
  813.   format.btitle "title" output.check
  814.   format.bvolume output
  815.   format.number.series output
  816.   address empty$
  817.     { editor empty$
  818.     { publisher new.sentence.checka }
  819.     { organization publisher new.sentence.checkb
  820.       organization output
  821.     }
  822.       if$
  823.       publisher output
  824.       format.date "year" output.check
  825.     }
  826.     { address output.nonnull
  827.       format.date "year" output.check
  828.       new.sentence
  829.       editor empty$
  830.     'skip$
  831.     { organization output }
  832.       if$
  833.       publisher output
  834.     }
  835.   if$
  836.   new.block
  837.   note output
  838.   fin.entry
  839. }
  840.  
  841. FUNCTION {techreport}
  842. { output.bibitem
  843.   format.authors "author" output.check
  844.   new.block
  845.   format.title "title" output.check
  846.   new.block
  847.   format.tr.number output.nonnull
  848.   institution "institution" output.check
  849.   address output
  850.   format.date "year" output.check
  851.   new.block
  852.   note output
  853.   fin.entry
  854. }
  855.  
  856. FUNCTION {unpublished}
  857. { output.bibitem
  858.   format.authors "author" output.check
  859.   new.block
  860.   format.title "title" output.check
  861.   new.block
  862.   note "note" output.check
  863.   format.date output
  864.   fin.entry
  865. }
  866.  
  867. FUNCTION {default.type} { misc }
  868.  
  869. MACRO {jan} {"Jan."}
  870.  
  871. MACRO {feb} {"Feb."}
  872.  
  873. MACRO {mar} {"Mar."}
  874.  
  875. MACRO {apr} {"Apr."}
  876.  
  877. MACRO {may} {"May"}
  878.  
  879. MACRO {jun} {"June"}
  880.  
  881. MACRO {jul} {"July"}
  882.  
  883. MACRO {aug} {"Aug."}
  884.  
  885. MACRO {sep} {"Sept."}
  886.  
  887. MACRO {oct} {"Oct."}
  888.  
  889. MACRO {nov} {"Nov."}
  890.  
  891. MACRO {dec} {"Dec."}
  892.  
  893. MACRO {acmcs} {"ACM Comput. Surv."}
  894.  
  895. MACRO {acta} {"Acta Inf."}
  896.  
  897. MACRO {cacm} {"Commun. ACM"}
  898.  
  899. MACRO {ibmjrd} {"IBM J. Res. Dev."}
  900.  
  901. MACRO {ibmsj} {"IBM Syst.~J."}
  902.  
  903. MACRO {ieeese} {"IEEE Trans. Softw. Eng."}
  904.  
  905. MACRO {ieeetc} {"IEEE Trans. Comput."}
  906.  
  907. MACRO {ieeetcad}
  908.  {"IEEE Trans. Comput.-Aided Design Integrated Circuits"}
  909.  
  910. MACRO {ipl} {"Inf. Process. Lett."}
  911.  
  912. MACRO {jacm} {"J.~ACM"}
  913.  
  914. MACRO {jcss} {"J.~Comput. Syst. Sci."}
  915.  
  916. MACRO {scp} {"Sci. Comput. Programming"}
  917.  
  918. MACRO {sicomp} {"SIAM J. Comput."}
  919.  
  920. MACRO {tocs} {"ACM Trans. Comput. Syst."}
  921.  
  922. MACRO {tods} {"ACM Trans. Database Syst."}
  923.  
  924. MACRO {tog} {"ACM Trans. Gr."}
  925.  
  926. MACRO {toms} {"ACM Trans. Math. Softw."}
  927.  
  928. MACRO {toois} {"ACM Trans. Office Inf. Syst."}
  929.  
  930. MACRO {toplas} {"ACM Trans. Prog. Lang. Syst."}
  931.  
  932. MACRO {tcs} {"Theoretical Comput. Sci."}
  933.  
  934. MACRO {advp} {"Adv. Phys."}
  935. MACRO {ajp} {"Am. J. Phys."}
  936. MACRO {ao} {"Appl. Opt."}
  937. MACRO {apl} {"Appl. Phys. Lett."}
  938. MACRO {apj} {"Astrophys. J."}
  939. MACRO {baps} {"Bull. Am. Phys. Soc."}
  940. MACRO {cpc} {"Computer Phys. Comm."}
  941. MACRO {cppcf} {"Comments Plasma Phys. Controlled Fusion"}
  942. MACRO {fed} {"Fusion Eng. Design"}
  943. MACRO {ft} {"Fusion Tech."}
  944. MACRO {ieeens} {"IEEE Trans. Nucl. Sci."}
  945. MACRO {ieeeps} {"IEEE Trans. Plasma Sci."}
  946. MACRO {ijimw} {"Int. J. Infrared Millimeter Waves"}
  947. MACRO {ip} {"Infrared Phys."}
  948. MACRO {jap} {"J. Appl. Phys."}
  949. MACRO {jcp} {"J. Comput. Phys."}
  950. MACRO {jetp} {"Sov. Phys.-JETP"}
  951. MACRO {jfe} {"J. Fusion Energy"}
  952. MACRO {jfm} {"J. Fluid Mech."}
  953. MACRO {jgr} {"J. Geophys. Res."}
  954. MACRO {jmp} {"J. Math. Phys."}
  955. MACRO {jne} {"J. Nucl. Energy"}
  956. MACRO {jnec} {"J. Nucl. Energy, Part C"}
  957. MACRO {jnm} {"J. Nucl. Mater."}
  958. MACRO {josa} {"J. Opt. Soc. Am."}
  959. MACRO {jpp} {"J. Plasma Phys."}
  960. MACRO {jpsj} {"J. Phys. Soc. Jpn"}
  961. MACRO {jvst} {"J. Vac. Sci. Technol."}
  962. MACRO {nedf} {"Nucl. Eng. Design/Fusion"}
  963. MACRO {nf} {"Nucl. Fusion"}
  964. MACRO {nim} {"Nucl. Instrum. Methods"}
  965. MACRO {nimpr} {"Nucl. Instrum. Methods Phys. Research"}
  966. MACRO {nt/f} {"Nucl. Tech./Fusion"}
  967. MACRO {pf} {"Phys. Fluids"}
  968. MACRO {pfa} {"Phys. Fluids A"}
  969. MACRO {pfb} {"Phys. Fluids B"}
  970. MACRO {pl} {"Phys. Lett."}
  971. MACRO {pla} {"Phys. Lett. A"}
  972. MACRO {pnas} {"Proc. Nat. Acad. Sci. USA"}
  973. MACRO {pp} {"Plasma Phys."}
  974. MACRO {ppcf} {"Plasma Phys. Controlled Fusion"}
  975. MACRO {prl} {"Phys. Rev. Lett."}
  976. MACRO {pr} {"Phys. Rev."}
  977. MACRO {pra} {"Phys. Rev. A"}
  978. MACRO {ps} {"Physica Scripta"}
  979. MACRO {rmp} {"Rev. Mod. Phys."}
  980. MACRO {rsi} {"Rev. Sci. Instrum."}
  981. MACRO {sjpp} {"Sov. J. Plasma Phys."}
  982. MACRO {spd} {"Sov. Phys.-Dokl."}
  983. MACRO {sptp} {"Sov. Phys.-Tech. Phys."}
  984. MACRO {spu} {"Sov. Phys.-Usp."}
  985.  
  986. READ
  987.  
  988. FUNCTION {sortify}
  989. { purify$
  990.   "l" change.case$
  991. }
  992.  
  993. INTEGERS { len }
  994.  
  995. FUNCTION {chop.word}
  996. { 's :=
  997.   'len :=
  998.   s #1 len substring$ =
  999.     { s len #1 + global.max$ substring$ }
  1000.     's
  1001.   if$
  1002. }
  1003.  
  1004. INTEGERS { et.al.char.used }
  1005.  
  1006. FUNCTION {initialize.et.al.char.used}
  1007. { #0 'et.al.char.used :=
  1008. }
  1009.  
  1010. EXECUTE {initialize.et.al.char.used}
  1011.  
  1012. FUNCTION {format.lab.names}
  1013. { 's :=
  1014.   s num.names$ 'numnames :=
  1015.   numnames #1 >
  1016.     { numnames #2 >
  1017.        { s #1 "{vv }{ll}" format.name$ " et~al." * }
  1018.        { s #1 "{vv }{ll}" format.name$
  1019.          s #2 "{ff }{vv }{ll}{ jj}" format.name$ "others" =
  1020.             { " et~al." * }
  1021.             { " and " * s #2 "{vv }{ll}" format.name$ * }
  1022.          if$
  1023.        }
  1024.       if$
  1025.     }
  1026.     { s #1 "{vv }{ll}" format.name$ }
  1027.   if$
  1028. }
  1029.  
  1030. FUNCTION {author.key.label}
  1031. { author empty$
  1032.     { key empty$
  1033.     { cite$ #1 #3 substring$ }
  1034.     { key #3 text.prefix$ }
  1035.       if$
  1036.     }
  1037.     { author format.lab.names }
  1038.   if$
  1039. }
  1040.  
  1041. FUNCTION {author.editor.key.label}
  1042. { author empty$
  1043.     { editor empty$
  1044.     { key empty$
  1045.         { cite$ #1 #3 substring$ }
  1046.         { key #3 text.prefix$ }
  1047.       if$
  1048.     }
  1049.     { editor format.lab.names }
  1050.       if$
  1051.     }
  1052.     { author format.lab.names }
  1053.   if$
  1054. }
  1055.  
  1056. FUNCTION {author.key.organization.label}
  1057. { author empty$
  1058.     { key empty$
  1059.     { organization empty$
  1060.         { cite$ #1 #3 substring$ }
  1061.         { "The " #4 organization chop.word #9 text.prefix$ }
  1062.       if$
  1063.     }
  1064.     { key #3 text.prefix$ }
  1065.       if$
  1066.     }
  1067.     { author format.lab.names }
  1068.   if$
  1069. }
  1070.  
  1071. FUNCTION {editor.key.organization.label}
  1072. { editor empty$
  1073.     { key empty$
  1074.     { organization empty$
  1075.         { cite$ #1 #3 substring$ }
  1076.         { "The " #4 organization chop.word #9 text.prefix$ }
  1077.       if$
  1078.     }
  1079.     { key #3 text.prefix$ }
  1080.       if$
  1081.     }
  1082.     { editor format.lab.names }
  1083.   if$
  1084. }
  1085.  
  1086. FUNCTION {calc.label}
  1087. { type$ "book" =
  1088.   type$ "inbook" =
  1089.   or
  1090.     'author.editor.key.label
  1091.     { type$ "proceedings" =
  1092.     'editor.key.organization.label
  1093.     { type$ "manual" =
  1094.         'author.key.organization.label
  1095.         'author.key.label
  1096.       if$
  1097.     }
  1098.       if$
  1099.     }
  1100.   if$
  1101.   duplicate$
  1102.   " " * year field.or.null purify$ #-1 #4 substring$
  1103.   *
  1104.   'label :=
  1105.   year field.or.null purify$ #-1 #4 substring$
  1106.   *
  1107.   sortify 'sort.label :=
  1108. }
  1109.  
  1110. FUNCTION {sort.format.names}
  1111. { 's :=
  1112.   #1 'nameptr :=
  1113.   ""
  1114.   s num.names$ 'numnames :=
  1115.   numnames 'namesleft :=
  1116.     { namesleft #0 > }
  1117.     { nameptr #1 >
  1118.     { "   " * }
  1119.     'skip$
  1120.       if$                        % apalike uses initials
  1121.       s nameptr "{vv{ } }{ll{ }}{  f{ }}{  jj{ }}" format.name$ 't := % <= here
  1122.       nameptr numnames = t "others" = and
  1123.     { "et al" * }
  1124.     { t sortify * }
  1125.       if$
  1126.       nameptr #1 + 'nameptr :=
  1127.       namesleft #1 - 'namesleft :=
  1128.     }
  1129.   while$
  1130. }
  1131.  
  1132. FUNCTION {sort.format.title}
  1133. { 't :=
  1134.   "A " #2
  1135.     "An " #3
  1136.       "The " #4 t chop.word
  1137.     chop.word
  1138.   chop.word
  1139.   sortify
  1140.   #1 global.max$ substring$
  1141. }
  1142.  
  1143. FUNCTION {author.sort}
  1144. { author empty$
  1145.     { key empty$
  1146.     { "to sort, need author or key in " cite$ * warning$
  1147.       ""
  1148.     }
  1149.     { key sortify }
  1150.       if$
  1151.     }
  1152.     { author sort.format.names }
  1153.   if$
  1154. }
  1155.  
  1156. FUNCTION {author.editor.sort}
  1157. { author empty$
  1158.     { editor empty$
  1159.     { key empty$
  1160.         { "to sort, need author, editor, or key in " cite$ * warning$
  1161.           ""
  1162.         }
  1163.         { key sortify }
  1164.       if$
  1165.     }
  1166.     { editor sort.format.names }
  1167.       if$
  1168.     }
  1169.     { author sort.format.names }
  1170.   if$
  1171. }
  1172.  
  1173. FUNCTION {author.organization.sort}
  1174. { author empty$
  1175.     { organization empty$
  1176.     { key empty$
  1177.         { "to sort, need author, organization, or key in " cite$ * warning$
  1178.           ""
  1179.         }
  1180.         { key sortify }
  1181.       if$
  1182.     }
  1183.     { "The " #4 organization chop.word sortify }
  1184.       if$
  1185.     }
  1186.     { author sort.format.names }
  1187.   if$
  1188. }
  1189.  
  1190. FUNCTION {editor.organization.sort}
  1191. { editor empty$
  1192.     { organization empty$
  1193.     { key empty$
  1194.         { "to sort, need editor, organization, or key in " cite$ * warning$
  1195.           ""
  1196.         }
  1197.         { key sortify }
  1198.       if$
  1199.     }
  1200.     { "The " #4 organization chop.word sortify }
  1201.       if$
  1202.     }
  1203.     { editor sort.format.names }
  1204.   if$
  1205. }
  1206.  
  1207. FUNCTION {presort}
  1208. { calc.label
  1209.   sort.label
  1210.   "    "
  1211.   *
  1212.   type$ "book" =
  1213.   type$ "inbook" =
  1214.   or
  1215.     'author.editor.sort
  1216.     { type$ "proceedings" =
  1217.     'editor.organization.sort
  1218.     { type$ "manual" =
  1219.         'author.organization.sort
  1220.         'author.sort
  1221.       if$
  1222.     }
  1223.       if$
  1224.     }
  1225.   if$
  1226.   *
  1227.   "    "
  1228.   *
  1229.   year field.or.null sortify
  1230.   *
  1231.   "    "
  1232.   *
  1233.   title field.or.null
  1234.   sort.format.title
  1235.   *
  1236.   #1 entry.max$ substring$
  1237.   'sort.key$ :=
  1238. }
  1239.  
  1240. ITERATE {presort}
  1241.  
  1242. SORT
  1243.  
  1244. STRINGS { longest.label last.sort.label next.extra }
  1245.  
  1246. INTEGERS { longest.label.width last.extra.num }
  1247.  
  1248. FUNCTION {initialize.longest.label}
  1249. { "" 'longest.label :=
  1250.   #0 int.to.chr$ 'last.sort.label :=
  1251.   "" 'next.extra :=
  1252.   #0 'longest.label.width :=
  1253.   #0 'last.extra.num :=
  1254. }
  1255.  
  1256. FUNCTION {forward.pass}
  1257. { last.sort.label sort.label =
  1258.     { last.extra.num #1 + 'last.extra.num :=
  1259.       last.extra.num int.to.chr$ 'extra.label :=
  1260.     }
  1261.     { "a" chr.to.int$ 'last.extra.num :=
  1262.       "" 'extra.label :=
  1263.       sort.label 'last.sort.label :=
  1264.     }
  1265.   if$
  1266. }
  1267.  
  1268. FUNCTION {reverse.pass}
  1269. { next.extra "b" =
  1270.     { "a" 'extra.label := }
  1271.     'skip$
  1272.   if$
  1273.   label extra.label * 'label :=
  1274.   label width$ longest.label.width >
  1275.     { label 'longest.label :=
  1276.       label width$ 'longest.label.width :=
  1277.     }
  1278.     'skip$
  1279.   if$
  1280.   extra.label 'next.extra :=
  1281. }
  1282.  
  1283. EXECUTE {initialize.longest.label}
  1284.  
  1285. ITERATE {forward.pass}
  1286.  
  1287. REVERSE {reverse.pass}
  1288.  
  1289. FUNCTION {begin.bib}
  1290. { et.al.char.used
  1291.     { "\newcommand{\etalchar}[1]{$^{#1}$}" write$ newline$ }
  1292.     'skip$
  1293.   if$
  1294.   preamble$ empty$
  1295.     'skip$
  1296.     { preamble$ write$ newline$ }
  1297.   if$
  1298.   "\begin{thebibliography}{"  longest.label  * "}" * write$ newline$
  1299. }
  1300.  
  1301. EXECUTE {begin.bib}
  1302.  
  1303. EXECUTE {init.state.consts}
  1304.  
  1305. ITERATE {call.type$}
  1306.  
  1307. FUNCTION {end.bib}
  1308. { newline$
  1309.   "\end{thebibliography}" write$ newline$
  1310. }
  1311.  
  1312. EXECUTE {end.bib}
  1313.